//审核未通过
function delBlogs(blogId){
	jQuery.ajax({
		type : "POST",
		url : ctx + "/blogManage/delBlogs/"+blogId,
		data : "",
		dataType : "json",
		success : function(data) {
			alert(data.msg);
			blogUnCheckInit();
		}
	});
}
//审核通过
function passBlogs(blogId){
	jQuery.ajax({
		type : "POST",
		url : ctx + "/blogManage/passBlogs/"+blogId,
		data : "",
		dataType : "json",
		success : function(data) {
			alert(data.msg);
			blogUnCheckInit();
		}
	});
}
function blogUnCheckInit(){
	jQuery.ajax({
		type : "GET",
		url : ctx + "/blogManage/selUnCheckBlogs",
		data : "",
		dataType : "json",
		success : function(blogs) {
			$("#unCheckBlogs").empty();
			if(blogs.code = "1"){
				$.each(blogs.data,function(i) {
					var blogStr = getBlogViewLabel(blogs.data[i],i);
					$("#unCheckBlogs").append(blogStr);
				});
			}else{
				alert(blogs.msg);
			}

		}
	});
}
function getBlogViewLabel(blog,i){
	var str =  "<tr >"
		+"<td>"+blog.blogId+"</td>"
		+"<td>"+blog.blogInfo+"</td>"
		+"<td>"+blog.nickname+"</td>"
		+"<td><a href=\"#\" onclick='passBlogs("+blog.blogId+")' class=\"btn btn-info\">YES</a> &nbsp; <a href=\"#\" onclick='delBlogs("+blog.blogId+")' class=\"btn btn-danger\">NO</a></td>"
		+"</tr>"
	return str;
}

